/*
 * Copyright (c) 2010, Nikolaus Moll
 * All rights reserved.
 */
package net.miblounge.gradecalculator.guicommon.widgets;

public class TreeIndex {
	private final int row;
	private final TreeIndex parent;
	
	public TreeIndex(final int row)
	{
		this(row, null);
	}

	public TreeIndex(final int row, final TreeIndex parent)
	{
		this.row = row;
		this.parent = parent;
	}
	
	public TreeIndex getParent()
	{
		return parent;
	}
	
	public int getRow()
	{
		return row;
	}
	
	@Override
	public String toString()
	{
		if (parent != null) {
			return parent.toString() + "-" + row;
		}

		return String.valueOf(row);
	}
}
